package pers.cj.pdos.mapper;

import org.apache.ibatis.annotations.Param;
import pers.cj.pdos.entity.BorrowOut;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import pers.cj.pdos.vo.BorrowInVo;
import pers.cj.pdos.vo.BorrowOutVo;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 借出单生成后需要仓库管理关出库操作；后面如果是转销售后，状态改成已归还;如果是还的操作，则仓库管理员还需要进行入库操作 Mapper 接口
 * </p>
 *
 * @author chenj
 * @since 2019-11-04
 */
public interface BorrowOutMapper extends BaseMapper<BorrowOut> {
    List<BorrowOutVo> listVo(@Param("companyId") String companyId,
                             @Param("page") Integer page,
                             @Param("limit") Integer limit,
                             @Param("status") Integer status,
                             @Param("close") Boolean close,
                             @Param("search") String search,
                             @Param("no") String no,
                             @Param("goodsName") String goodsName,
                             @Param("remark") String remark,
                             @Param("custom") String custom,
                             @Param("makeTime1") Date makeTime1,
                             @Param("makeTime2")Date makeTime2,
                             @Param("storeId") String storeId,
                             @Param("userStoreId") String userStoreId,
                             @Param("userId") String userId,
                             @Param("date1")Date date1,
                             @Param("date2")Date date2,
                             @Param("houseId") String houseId,
                             @Param("makeUserId") String makeUserId,
                             @Param("outStatus")Integer outStatus);

    Long count(@Param("companyId") String companyId,
               @Param("status") Integer status,
               @Param("close") Boolean close,
               @Param("search") String search,
               @Param("no") String no,
               @Param("goodsName") String goodsName,
               @Param("remark") String remark,
               @Param("custom") String custom,
               @Param("makeTime1") Date makeTime1,
               @Param("makeTime2")Date makeTime2,
               @Param("storeId") String storeId,
               @Param("userStoreId") String userStoreId,
               @Param("userId") String userId,
               @Param("date1")Date date1,
               @Param("date2")Date date2,
               @Param("houseId") String houseId,
               @Param("makeUserId") String makeUserId,
               @Param("outStatus")Integer outStatus);

    BorrowOutVo getVoById(@Param("id") String id);

    List<BorrowOutVo> listVoByIds(@Param("ids") List<String> ids);
}
